package cn.edu.xmu.orderpayment.order.model.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Yujie Lin
 * @date 2021/12/8 19:41
 */
public enum ActState {
    DRAFT(0, "草稿态"),
    ONLINE(1, "上线态"),
    OFFLINE(2, "下线态");

    private static final Map<Integer, ActState> ACT_STATE_MAP;
    static {
        ACT_STATE_MAP = new HashMap();
        for (ActState enum1 : values()) {
            ACT_STATE_MAP.put(enum1.code, enum1);
        }
    }
    private int code;
    private String description;
    ActState(int code, String description) {
        this.code = code;
        this.description = description;
    }
    public static ActState getActStateByCode(Integer code) {
        return ACT_STATE_MAP.get(code);
    }
    public Integer getCode() {
        return code;
    }
    public String getDescription() {
        return description;
    }
}
